<script type="text/html" template
        lay-url="{{ window.globalConfig.url_download_category + '/' + layui.router().search.cat_id }}"
        lay-done="layui.data.done(d);">
    <title>分类详情</title>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <a href="javascript:history.back()"
                           class="layui-btn layui-btn-primary layui-btn-sm" id="goBack">返回上级</a>
                        {{ d.data.title }}
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-form" lay-filter="LAY-home-downloadCategory-listform"
                             id="LAY-home-downloadCategory-listform"
                             style="padding: 20px 30px 0 0;">
                            <div class="layui-form-item">
                                <label class="layui-form-label">分类名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="cat_name" value="{{ d.data.cat_name || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入分类名称" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">自定义路由</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="urlrewriter" value="{{ d.data.urlrewriter || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入自定义路由" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">是否显示</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="is_show" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_show){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline">
                                    <input type="number" name="sort_order" lay-affix="number" min="0"
                                           value="{{ d.data.sort_order | 0 }}"
                                           lay-verify="required|number" placeholder="请输入排序" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>


                            <!--        <input type="hidden" name="content" id="editor-content" value="{{ d.params.content }}">-->
                            <input type="hidden" name="cat_id" value="{{ d.data.cat_id }}">
                            <input type="hidden" name="parent_id" value="{{ d.data.parent_id || layui.router().search.parent_id || 0 }}">
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-inline">
                                    <input type="button" lay-submit
                                           lay-filter="LAY-home-downloadCategory-listform-submit"
                                           value="保存"
                                           class="layui-btn">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="res/modules/downloadCategory.js"></script>
